package page_rank

import "fmt"

type IPage interface {
	fmt.Stringer

	ID() string

	GetWeight() float64
	SetWeight(float64)

	GetLinks() []IPage
	AddLink(IPage)
}


type IPageSlice []IPage

func (me IPageSlice) Len() int {
	return len(me)
}

func (me IPageSlice) Less(i,j int) bool {
	return me[i].GetWeight() < me[j].GetWeight()
}

func (me IPageSlice) Swap(i,j int) {
	me[i], me[j] = me[j], me[i]
}